package pl.pages;

import java.text.Format;
import java.text.SimpleDateFormat;

import org.apache.tapestry.IActionListener;
import org.apache.tapestry.IComponent;
import org.apache.tapestry.IRequestCycle;
import org.apache.tapestry.html.BasePage;
import org.apache.tapestry.record.PropertyChangeObserver;

import pl.model.Celebrity;

public abstract class Details extends BasePage {
	
//	private Celebrity c;
	private String occu;
	public abstract Celebrity getCelebrity();
	public abstract void setCelebrity(Celebrity c);
//    public Celebrity getCelebrity(){System.out.println("getC");return c;};
//    public void setCelebrity(Celebrity c){this.c=c; System.out.println("setC");};;
    public Format getDateFormat(){
    	return new SimpleDateFormat("MMM d, yyyy");
    }
    public String getOccupation(){
    	System.out.println("Details.getOccu " + getCelebrity().getOccupation() + " this.occu: " + this.occu + " celebrity: " + getCelebrity());
    	return getCelebrity().getOccupation();
    }
    public void setOccupation(String occu){
    	System.out.println("Details.setOccu " + occu + " this.occu: " + this.occu + " celebrity: " + getCelebrity());
    	this.occu = occu;
    	
    	getCelebrity().setOccupation(occu);
    }
}
